// 导入baseService
import { fetch, apiFormat, apiFormat2 } from '@/service/baseService';
// gps
const listApi = '/api/car-center/device';                                // 设备中心列表-分页  method 'GET'
const bindApi = '/api/car-center/device/{deviceNum}/bindCar/{carNum}';   // 设备绑定车辆操作   method 'PUT'
const unbindApi = '/api/car-center/device/unbindCar/{deviceNum}';   // 设备解绑车辆操作   method 'PUT'
const giveAwayApi = '/api/car-center/device/dispense/{orgId}';   // 分发设备   method 'PUT'
const sameApi = '/api/car-center/device/dispense/{orgId}';   // 同步设备   method 'PUT' // 等api
const exportApi = '/api/car-center/device/export';            // 导出设备   method 'GET'
// ty
const listTYApi = '/api/car-center/tianyan';                                // 设备中心列表-分页  method 'GET'
const giveAwayTYApi = '/api/car-center/tianyan/dispense/{orgId}';   // 分发设备   method 'PUT'
const sameTYApi = '/api/car-center/tianyan/dispense/{orgId}';   // 同步设备   method 'PUT' // 等api
const exportTYApi = '/api/car-center/tianyan/export';            // 导出设备 -天眼   method 'GET'
const bindTYApi = '/api/car-center/tianyan/{deviceNum}/bind/{orderNum}';   // 设备绑定订单   method 'PUT'
const unbindTYApi = '/api/car-center/tianyan/{deviceNum}/unbind/{orderNum}';   // 设备解绑订单   method 'PUT'

export default {
  // gps
  getList: (opt, payload) => fetch.get(apiFormat2(listApi, opt), payload),
  bindCar: (opt, payload) => fetch.put(apiFormat(bindApi, opt), payload),
  unbind: (opt, payload) => fetch.put(apiFormat(unbindApi, opt), payload),
  giveAway: (opt, payload) => fetch.put(apiFormat(giveAwayApi, opt), payload),
  same: (opt, payload) => fetch.put(apiFormat(sameApi, opt), payload),
  export: (opt, payload) => fetch.get(apiFormat2(exportApi, opt), payload),
  // ty
  getListTY: (opt, payload) => fetch.get(apiFormat2(listTYApi, opt), payload),
  giveAwayTY: (opt, payload) => fetch.put(apiFormat(giveAwayTYApi, opt), payload),
  sameTY: (opt, payload) => fetch.put(apiFormat(sameTYApi, opt), payload),
  exportTY: (opt, payload) => fetch.get(apiFormat2(exportTYApi, opt), payload),
  bindTYOrder: (opt, payload) => fetch.put(apiFormat(bindTYApi, opt), payload),
  unbindTYOrder: (opt, payload) => fetch.put(apiFormat(unbindTYApi, opt), payload)
};
